import './icon.scss';
import { cssPrefix } from '../baseData';

import React from 'react';

export default class Icon extends React.Component{
  render(){
    let { type, className, spin, onClick, data, title } = this.props;
    !className && (className = '');
    className += ` ${cssPrefix}icon-${type}`;
    spin && (className += ` ${cssPrefix}icon-spin`)

    return <span className={className} title={title} onClick={onClick && onClick.bind(this, data)}></span>
  }
}